package com.summer.First.day03;

public class Soultion4 {
}
class Solution {
    public String replaceSpace(String s) {
        int length = s.length();
        char[] carr=new char[length*3];
        int size=0;
        for(int i=0;i<length;i++){
            char c=s.charAt(i);
            if(c==' '){
                carr[size++]='%';
                carr[size++]='2';
                carr[size++]='0';

            }else{
                carr[size++]=c;
            }

        }
        String newS = new String(carr,0,size);
        return newS;
    }
}